// @ts-ignore
import { request } from '@umijs/max';

// 新增好文收藏
export async function addArticle(body: any) {
  return request<API.ReqResult>(`/api/brain_space/good_article`, {
    method: 'POST',
    data: body,
  });
}

// 好文收藏列表
export async function goodArticle(params: any) {
  return request<API.ReqResult>(`/api/brain_space/good_article`, {
    method: 'GET',
    params,
  });
}

// 删除好文收藏
export async function delArticle(cognition_id: any) {
  return request<API.ReqResult>(`/api/brain_space/good_article`, {
    method: 'DELETE',
    params: { cognition_id },
  });
}

// 大脑元数据
export async function cognitionTypes(params: any) {
  return request<API.ReqResult>(`/api/brain_space/cognition_types`, {
    method: 'GET',
    params,
  });
}

// 公文模板列表
export async function getFormatList(params: any) {
  return request<API.ReqResult>(`/api/brain_space/format`, {
    method: 'GET',
    params,
  });
}

// 定期收集列表
export async function getCollectionList(params: any) {
  return request<API.ReqResult>(`/api/brain_space/collection`, {
    method: 'GET',
    params,
  });
}

// 新增定期收集
export async function addCollection(body: any) {
  return request<API.ReqResult>(`/api/brain_space/collection`, {
    method: 'POST',
    data: body,
  });
}

// 删除定期收集
export async function delCollection(cognition_id: any) {
  return request<API.ReqResult>(`/api/brain_space/collection`, {
    method: 'DELETE',
    params: { cognition_id },
  });
}

// 大脑入口页面 对话查询
export async function search_statistics(body: any) {
  return request<API.ReqResult>(`/api/brain_space/search_statistics`, {
    method: 'POST',
    data: body,
  });
}

// 大脑空间搜索(具体结果)
export async function search(body: any) {
  return request<API.ReqResult>(`/api/brain_space/search`, {
    method: 'POST',
    data: body,
  });
}

// 好词好句 新增 -文件上传
export async function addGoodSentence(formData: any) {
  return request<API.ReqResult>(`/api/brain_space/good_sentence`, {
    method: 'POST',
    requestType: 'form',
    data: formData,
  });
}
// 好文收藏 新增 - 文件上传
export async function addGoodArticle(formData: any) {
  return request<API.ReqResult>('/api/brain_space/good_article', {
    method: 'POST',
    requestType: 'form',
    data: formData,
  });
}
// 事实空间 新增 -文件上传
export async function addFact(formData: any) {
  return request<API.ReqResult>(`/api/brain_space/fact`, {
    method: 'POST',
    requestType: 'form',
    data: formData,
  });
}
// 新增定期收集 -文件上传
export async function addCollection2(formData: any) {
  return request<API.ReqResult>(`/api/brain_space/collection`, {
    method: 'POST',
    requestType: 'form',
    data: formData,
  });
}
// 行政局知识 - 查询
export async function brain_space_fact(params: any) {
  return request<API.ReqResult>(`/api/brain_space/fact`, {
    method: 'GET',
    params,
  });
}
// 行政局知识 - 删除
export async function delete_brain_space_fact(params: any) {
  return request<API.ReqResult>(`/api/brain_space/fact`, {
    method: 'DELETE',
    params,
  });
}
// 重要讲话 - 查询
export async function brain_space_speech(params: any) {
  return request<API.ReqResult>(`/api/brain_space/speech`, {
    method: 'GET',
    params,
  });
}
// 好词好句 - 查询
export async function brain_space_good_sentence(params: any) {
  return request<API.ReqResult>(`/api/brain_space/good_sentence`, {
    method: 'GET',
    params,
  });
}
// 好词好句 - 删除
export async function delete_brain_space_good_sentence(cognition_id: any) {
  return request<API.ReqResult>(`/api/brain_space/good_sentence`, {
    method: 'DELETE',
    params: { cognition_id },
  });
}
// 点踩 - 查询
export async function brain_space_feedback_items(params: any) {
  return request<API.ReqResult>(`/api/feedback_items`, {
    method: 'GET',
    params,
  });
}
// 更新选中文章顺序
export async function update_display_order(body: any) {
  return request<API.ReqResult>(`/api/writing_session/update_display_order`, {
    method: 'POST',
    data: body,
  });
}
